package GameMain.Model
{
	import GameMain.Game;
	import GameMain.View.PTGame.GameManager;
	
	import flash.display.BitmapData;
	import flash.display.Sprite;

	public class EntitySkill extends EntityMove
	{
		
		private var _skillID:int = 0;
		
		public function EntitySkill()
		{
			super();
		}
		
		public function setSkillID(skillID:int):void
		{
			this._skillID = skillID;
			var skillC:Class = GameManager.getSikllClass(this._skillID);
			var sp:Sprite = new skillC as Sprite;
			this.addChild(sp);
		}
		
		override protected function setDirection(_time:Number):void
		{
			var vx:Number = this._vx + this._ax*_time;
			var vy:Number = this._vy + this._ay*_time;
			var rot:Number;
			if(this._face == EntityMove.FACE_RIGHT)
				rot = Math.atan2(vx,vy)*180/Math.PI - 90;
			else
				rot = Math.atan2(vx,vy)*180/Math.PI + 90;
			this.rotation = rot;
			this.setVisible(true);
		}
	}
}